package net.csdn.business.kanban.api.service;

import com.baomidou.mybatisplus.extension.service.IService;
import net.csdn.business.kanban.api.entity.KanbanDetail;
import net.csdn.business.kanban.common.domain.request.MoveIssueParam;

import java.util.*;

/**
 * @ClassName KanbanService
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/9/13
 **/
public interface KanbanDetailService extends IService<KanbanDetail> {
    /**
     * 获取issueIds
     * @param projectId
     * @param businessType
     * @param kanbanId
     * @return
     */
    List<String> getIssueIds(Long projectId,Integer businessType,String kanbanId);

    /**
     * 删除看板内容明细
     * @param kanbanId
     * @return
     */
    boolean removeKanbanDetails(String kanbanId);

    /**
     * 从列表中移除任务
     * @param id
     * @return
     */
    boolean deleteKanbanDetail(String id);

    /**
     * 看板明细列表
     * @param kanbanId limitNum
     * @return
     */
    List<KanbanDetail> kanbanDetailsList(String kanbanId,Long limitNum,Boolean archivedTask);

    /**
     * 归档任务
     * @param objectId
     * @param archivedTask
     * @return
     */
    boolean archived(String objectId,boolean archivedTask);

    /**
     * 根据objectid获取看板明细
     * @param objectId
     * @return
     */
    KanbanDetail getKanbanDetailByObjectId(String objectId);

    /**
     * 根据业务类型和ID查询明细
     * @param businessType
     * @param businessIds
     * @return
     */
    List<KanbanDetail> getKanbanDetail(Integer businessType,List<String> businessIds);

    /**
     * @Desc: 统计看板的任务条数
     * @author:liuzhisheng
     * @date: 2023/10/11 17:30
     */

    long countRow(String objectId);

    /**
     * @Desc: 清空看板中某个字段的全部内容
     * @author:liuzhisheng
     * @date: 2023/10/12 15:14
     */

    int removeFieldContentJson(String kanbanId, Long fieldId);


    /**
     * @Desc: 判断issue是否存在
     * @author:liuzhisheng
     * @date: 2023/10/11 17:30
     */

    boolean isBatchExist(String kanbanId,List<String> issueIds);

    /**
     * @Desc: 设置标题
     * @author: liuzhisheng
     * @date: 2023/10/30 18:19
     */
    void updateTitle(Long id,String filedValue);

    /**
     * @Desc: 设置负责人
     * @author: liuzhisheng
     * @date: 2023/10/30 18:23
     */
    void updateAssignee(Long id,String filedValue);

    /**
     * @Desc: 设置labels
     * @author: liuzhisheng
     * @date: 2023/10/30 18:23
     */
    void updateLabels(Long id,String filedValue);

    /**
     * @Desc: 设置里程碑
     * @author: liuzhisheng
     * @date: 2023/10/30 18:23
     */
    void updateMilepost(Long id,String filedValue);

    /**
     * @Desc: 设置自定义字段内容
     * @author: liuzhisheng
     * @date: 2023/10/30 18:23
     */
    void updateFieldContentJson(Long id,String filedValue);

    /**
     * @Desc: 根据issueId移除看板
     * @author: liuzhisheng
     * @date: 2023/11/15 14:13
     */
    void removeIssue(String issueId);

    /**
     * @Desc: 根据issueId获取所有的看板内容
     * @author: liuzhisheng
     * @date: 2023/11/15 16:49
     */
    List<KanbanDetail> queryIssueDetailList(String issueId);

    /**
     * @Desc: 批量更新
     * @author: liuzhisheng
     * @date: 2023/11/15 18:13
     */
    int batchUpdateIssueDetail(List<Long> ids, MoveIssueParam param);
}

